/*function userRecharge() {
    window.location.href = "userTransaction/showUserRecharge.action";
}*/


//付款
function payment(){
    if ($("#ordeMoney").val() == "") {
        alert("请输入金额");
        return;
    }
    var form=$("form");
    form.action="userTransaction/userRecharge.action";
    form.method="post";
    form.submit();
}


//提现
function putForward() {
    window.location.href = "userTransaction/showPutForward.action";
}

//前端非空验证（标签ID，提示语）
function nonEmpty(input, tips) {
    var inputval = $("#" + input).val();
    if (!inputval) {
        layer.tips('请输入'+tips+'!', '#' + input, {tips: [2, '#CC3333']});
        return false;
    }
    return true;
}

//持卡人姓名验证
function userNameCheck(input, tips){
    if(nonEmpty(input, tips)){
        var userName = $("#userName").val();
        $.ajax({
            url : "userTransaction/userNameCheck.action",
            data : {
                "userName" : userName
            },
            type : "post",
            dataType : "text",
            success : function (result) {
                if (result=="error") {
                    layer.tips('持卡人的姓名不对！', '#account11', {tips: [2, '#00ff00']});
                } else if (result=="success") {
                    // layer.tips('用户名已被使用！', '#account11', {tips: [2, '#CC3333']});
                }
            }
        });
    }
}

//验证银行卡号
function bankNumbeCheck(input, tips){
    if(nonEmpty(input, tips)){
    }
}





//用户绑定银行卡
function submission1() {
    if ($("#bank").val() == 0) {
        alert("带*号的为必填，请重新填写！！")
        return;
    };

    if ($("#userName").val() == "") {
        alert("带*号的为必填，请重新填写！！")
        return;
    };

    if ($("#bankNumbe").val() == "") {
        alert("带*号的为必填，请重新填写！！")
        return;
    };

    /*var password = $("#password").val();
    var password2 = $("#password2").val();
    if (password != password2) {
        alert("密码不一致，请从新输入！！")
        return;
    };*/

    var bank = $("#bank").val();
    var userName = $("#userName").val();
    var bankNumbe = $("#bankNumbe").val();

    $.ajax({
        url: "manageWork/addWork.action",
        data: {
            "workName": workName,
            "account": account,
            "workPwd": workPwd,
            "workSex": workSex,
            "workAge": workAge,
            "mobile": mobile,
            "post": post,
            "education": education,
            "deskId": deskId,
            "roleId": roleId,
            "workSite": workSite
        },
        type: "post",
        dataType: "text",
        success: function (res) {
            if (res == "success") {
                layer.msg("添加成功！！", {icon: 6, time: 1000}, function () {
                    layer.closeAll(layer.index);
                    window.parent.location.reload()
                });
            } else if (res == "error") {
                layer.msg("添加失败！！", {icon: 6, time: 1000}, function () {
                    layer.closeAll(layer.index);
                    window.parent.location.reload()
                });
            }
        }
    });


}


